package com.yf.dxapp.module.app.enums.app;

import com.google.common.base.Objects;

import java.util.stream.Stream;

/**
 * @author yxmds
 */

public enum AppCollectTypeEnum {

    PRODUCT(1, "商品"),

    ;

    Integer key;

    String name;

    AppCollectTypeEnum(Integer key, String name) {
        this.key = key;
        this.name = name;
    }

    public Integer getKey() {
        return key;
    }

    public String getName() {
        return name;
    }

    public static AppCollectTypeEnum getByKey(Integer key) {
        return Stream.of(AppCollectTypeEnum.values()).filter(e -> Objects.equal(e.getKey(), key)).findFirst().orElse(null);
    }

}
